﻿#include <iostream>
using namespace std;
#include "AVL.h"

int main()
{
    AVL<int> avl;
    int N;
    cin >> N;
    int x;
    for (int i = 0; i < N; i++) {
        cin >> x;
        avl.add(x);
    }

    avl.erase(1);
    avl.traverseinOrder(avl.getRoot());
    cout << "AVL高度：" << avl.getHeight(avl.getRoot()) +1<< endl;
    cout <<"最近叶子结点值："<< avl.valueofNearestLeaf();
    return 0;
}